package com.sgb.kjwl.view.ui.adapter.home;

import android.content.Context;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.RentingEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class RentingAdapter extends BaseRecycleAdapter<RentingEntity> {

    private TextView contentView;

    public RentingAdapter(Context context, List<RentingEntity> datas) {
        super(context, R.layout.item_renting, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final RentingEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        contentView = holder.getItem().findViewById(R.id.content_view);
        contentView.setText("| " + entity.getConstructionTime() + "天 | " + entity.getCity() + " " + entity.getDistrict());
    }

}
